var wineApp = wineApp || {};
wineApp.onenews = (function() {
    var params = $.url().param();
    var nid = params["nid"];
    var initPage = function() {
        loadInfo();
        var date = wineApp.tool.formateDate(new Date(), "yyyy-MM-dd");
        $('#post-date').html(date);
        if (nid == "10050") {
            wineApp.common.setSelectedMenu('jz');
        }
    }
    var resourceURL = wineApp.tool.getResourceURL();
    var loadInfo = function() {
        var ajaxUrl = wineApp.CONFIG.API.jzdetail
        wineApp.ajax.post(ajaxUrl, {
            id: nid
        }).done(function(data) {
            $('#content').html(data.detail.content);
            //$('#barcode').attr("src", resourceURL + "/" + data.detail.titleimg);
            $('.title').html(data.detail.title);
            $('#vcount').html(data.detail.vcount);
        });
    }
    return {
        initPage: initPage
    }
})();

$(document).ready(function() {
    //$('.wine_footer').remove();
    wineApp.common.initHeaderIcon(0, true, {
        camera: false,
        search: false
    });
    wineApp.onenews.initPage();

    //wineApp.common.initTabs('#tabs');
});